import request from "@/utils/request";
import { GEN_SERVER } from "@/config/baseUrl";

// 工艺路线列表查询
export function getProcessRouteList(data) {
  return request({
    url: GEN_SERVER["produce-server"] + "/data/processRoute/list",
    method: "post",
    data: data,
  });
}

// 工艺路线保存
export function saveProcessRoute(data) {
  return request({
    url: GEN_SERVER["produce-server"] + "/data/processRoute/addOrUpdate",
    method: "post",
    data: data,
  });
}

// 工艺路线详情
export function getProcessRouteDetail(id) {
  return request({
    url: GEN_SERVER["produce-server"] + "/data/processRoute/detail",
    method: "get",
    params: { id },
  });
}

// 工艺路线删除
export function deleteProcessRoute(ids) {
  return request({
    url: GEN_SERVER["produce-server"] + "/data/processRoute/deleteByIds",
    method: "post",
    params: { ids },
  });
}

// 保存工艺路线图
export function saveProcessRouteChart(data) {
  return request({
    url:
      GEN_SERVER["produce-server"] + "/data/processRoute/saveProcessRouteInfo",
    method: "post",
    data,
  });
}

// 获取工艺路线图
export function getProcessRouteChart(id) {
  return request({
    url:
      GEN_SERVER["produce-server"] + "/data/processRoute/queryProcessRouteInfo",
    method: "get",
    params: { id },
  });
}
